import { STATUS_CLOSE, STATUS_OPEN } from "@/common/constants"
import { ItemType } from "@ebonex/ebonex-ui/lib/quick-form/BaseForm/types"

export default ():ItemType[]=> {
  return [
    {
      label: "用户名",
      id: "userName",
      rules: [{ required: true }],
    },
    {
      label: "邮箱",
      id: "email",
      rules: [{ required: true, type:'email', message:"邮箱不能为空" }],
    },
    
    {
      label: "备注",
      id: "description",
      type:'text'
    },
    {
      label: "状态",
      id: "status",
      type:"switch",
      rules: [{ required: true }],
      formItemProps: {
        valuePropName:'checked',
        initialValue: `${STATUS_OPEN}`
      }, 
      transform: ({ value, key,values}:any) => value ? STATUS_OPEN : STATUS_CLOSE
    },
    {
      id: 'id',
      formItemProps: {
        hidden:true
      }
    }
  ]
}